import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login'
import Register from '@/views/register'

import Layout from '@/views/layout'
import Collect from '@/views/collect'
import User from '@/views/user'
import Like from '@/views/like'
import Article from '@/views/article'
Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login },
  { path: '/register', component: Register },

  {
    path: '/',
    component: Layout,
    children: [
      { path: '/article', component: Article },
      { path: '/collect', component: Collect },
      { path: '/user', component: User },
      { path: '/like', component: Like }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
